<template>
    <div>
        <div>子应用首页</div>
        <div class="msg-ipt-box">
            <input class="msg-ipt" type="text" v-model="formMsg" placeholder="请输入你想广播的话" />
        </div>
        <div class="msg-btn-box">
            <button class="msg-btn" @click="handleVuexMsgChange">发送广播</button>
        </div>
    </div>

</template>

<script>
    import { setState } from "@/utils/app-store";
    export default {
        data(){
            return{
                formMsg:''
            }
        },
        methods: {
            handleVuexMsgChange(){
                setState({
                    msg: this.formMsg
                });
            }
        }
    }
</script>